/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('cis', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CheckResultNodesLevelValue = {
  message?: string(name='Message'),
  targets?: [ 
    {
      target?: string(name='Target'),
      value?: string(name='Value'),
    }
  ](name='Targets'),
}

model CreateClusterCheckRequest {
  addonName?: string(name='AddonName'),
  clusterRegionId?: string(name='ClusterRegionId'),
  clusterUid?: string(name='ClusterUid'),
  ownerUid?: long(name='OwnerUid'),
  reportName?: string(name='ReportName'),
}

model CreateClusterCheckResponseBody = {
  code?: string(name='Code'),
  isSuccess?: boolean(name='IsSuccess'),
  reportUid?: string(name='ReportUid'),
  requestId?: string(name='RequestId'),
}

model CreateClusterCheckResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateClusterCheckResponseBody(name='body'),
}

async function createClusterCheckWithOptions(request: CreateClusterCheckRequest, runtime: Util.RuntimeOptions): CreateClusterCheckResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.addonName)) {
    query['AddonName'] = request.addonName;
  }
  if (!Util.isUnset(request.clusterRegionId)) {
    query['ClusterRegionId'] = request.clusterRegionId;
  }
  if (!Util.isUnset(request.clusterUid)) {
    query['ClusterUid'] = request.clusterUid;
  }
  if (!Util.isUnset(request.ownerUid)) {
    query['OwnerUid'] = request.ownerUid;
  }
  if (!Util.isUnset(request.reportName)) {
    query['ReportName'] = request.reportName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateClusterCheck',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createClusterCheck(request: CreateClusterCheckRequest): CreateClusterCheckResponse {
  var runtime = new Util.RuntimeOptions{};
  return createClusterCheckWithOptions(request, runtime);
}

model CreateClusterReportRequest {
  addonName?: string(name='AddonName'),
  clusterRegionId?: string(name='ClusterRegionId'),
  clusterUid?: string(name='ClusterUid'),
  ownerUid?: long(name='OwnerUid'),
  reportName?: string(name='ReportName'),
  templatePredicates?: [ string ](name='TemplatePredicates'),
}

model CreateClusterReportShrinkRequest {
  addonName?: string(name='AddonName'),
  clusterRegionId?: string(name='ClusterRegionId'),
  clusterUid?: string(name='ClusterUid'),
  ownerUid?: long(name='OwnerUid'),
  reportName?: string(name='ReportName'),
  templatePredicatesShrink?: string(name='TemplatePredicates'),
}

model CreateClusterReportResponseBody = {
  code?: string(name='Code'),
  isSuccess?: boolean(name='IsSuccess'),
  reportUid?: string(name='ReportUid'),
  requestId?: string(name='RequestId'),
}

model CreateClusterReportResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateClusterReportResponseBody(name='body'),
}

async function createClusterReportWithOptions(tmpReq: CreateClusterReportRequest, runtime: Util.RuntimeOptions): CreateClusterReportResponse {
  Util.validateModel(tmpReq);
  var request = new CreateClusterReportShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.templatePredicates)) {
    request.templatePredicatesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.templatePredicates, 'TemplatePredicates', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.addonName)) {
    query['AddonName'] = request.addonName;
  }
  if (!Util.isUnset(request.clusterRegionId)) {
    query['ClusterRegionId'] = request.clusterRegionId;
  }
  if (!Util.isUnset(request.clusterUid)) {
    query['ClusterUid'] = request.clusterUid;
  }
  if (!Util.isUnset(request.ownerUid)) {
    query['OwnerUid'] = request.ownerUid;
  }
  if (!Util.isUnset(request.reportName)) {
    query['ReportName'] = request.reportName;
  }
  if (!Util.isUnset(request.templatePredicatesShrink)) {
    query['TemplatePredicates'] = request.templatePredicatesShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateClusterReport',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createClusterReport(request: CreateClusterReportRequest): CreateClusterReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return createClusterReportWithOptions(request, runtime);
}

model CreateDiagnosisRequest {
  clusterRegionId?: string(name='ClusterRegionId'),
  clusterUid?: string(name='ClusterUid'),
  ownerUid?: long(name='OwnerUid'),
  target?: string(name='Target'),
  type?: string(name='Type'),
}

model CreateDiagnosisResponseBody = {
  code?: string(name='Code'),
  diagnosisId?: string(name='DiagnosisId'),
  isSuccess?: boolean(name='IsSuccess'),
  requestId?: string(name='RequestId'),
}

model CreateDiagnosisResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateDiagnosisResponseBody(name='body'),
}

async function createDiagnosisWithOptions(request: CreateDiagnosisRequest, runtime: Util.RuntimeOptions): CreateDiagnosisResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterRegionId)) {
    query['ClusterRegionId'] = request.clusterRegionId;
  }
  if (!Util.isUnset(request.clusterUid)) {
    query['ClusterUid'] = request.clusterUid;
  }
  if (!Util.isUnset(request.ownerUid)) {
    query['OwnerUid'] = request.ownerUid;
  }
  if (!Util.isUnset(request.target)) {
    query['Target'] = request.target;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDiagnosis',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createDiagnosis(request: CreateDiagnosisRequest): CreateDiagnosisResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDiagnosisWithOptions(request, runtime);
}

model CreateDiagnosisFeedbackRequest {
  advice?: string(name='Advice'),
  clusterRegionId?: string(name='ClusterRegionId'),
  clusterUid?: string(name='ClusterUid'),
  evaluation?: string(name='Evaluation'),
  isSolved?: boolean(name='IsSolved'),
  ownerUid?: long(name='OwnerUid'),
  satisfaction?: string(name='Satisfaction'),
  taskId?: string(name='TaskId'),
  taskName?: string(name='TaskName'),
}

model CreateDiagnosisFeedbackResponseBody = {
  code?: string(name='Code'),
  isSuccess?: boolean(name='IsSuccess'),
  requestId?: string(name='RequestId'),
}

model CreateDiagnosisFeedbackResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateDiagnosisFeedbackResponseBody(name='body'),
}

async function createDiagnosisFeedbackWithOptions(request: CreateDiagnosisFeedbackRequest, runtime: Util.RuntimeOptions): CreateDiagnosisFeedbackResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.advice)) {
    query['Advice'] = request.advice;
  }
  if (!Util.isUnset(request.clusterRegionId)) {
    query['ClusterRegionId'] = request.clusterRegionId;
  }
  if (!Util.isUnset(request.clusterUid)) {
    query['ClusterUid'] = request.clusterUid;
  }
  if (!Util.isUnset(request.evaluation)) {
    query['Evaluation'] = request.evaluation;
  }
  if (!Util.isUnset(request.isSolved)) {
    query['IsSolved'] = request.isSolved;
  }
  if (!Util.isUnset(request.ownerUid)) {
    query['OwnerUid'] = request.ownerUid;
  }
  if (!Util.isUnset(request.satisfaction)) {
    query['Satisfaction'] = request.satisfaction;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDiagnosisFeedback',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createDiagnosisFeedback(request: CreateDiagnosisFeedbackRequest): CreateDiagnosisFeedbackResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDiagnosisFeedbackWithOptions(request, runtime);
}

model CreateReportTaskRuleRequest {
  clusterRegionId?: string(name='ClusterRegionId'),
  clusterUid?: string(name='ClusterUid'),
  ownerUid?: long(name='OwnerUid'),
  reportName?: string(name='ReportName'),
  scheduleRule?: string(name='ScheduleRule'),
  timeZoneId?: string(name='TimeZoneId'),
}

model CreateReportTaskRuleResponseBody = {
  code?: string(name='Code'),
  isSuccess?: boolean(name='IsSuccess'),
  requestId?: string(name='RequestId'),
  ruleId?: string(name='RuleId'),
}

model CreateReportTaskRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateReportTaskRuleResponseBody(name='body'),
}

async function createReportTaskRuleWithOptions(request: CreateReportTaskRuleRequest, runtime: Util.RuntimeOptions): CreateReportTaskRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterRegionId)) {
    query['ClusterRegionId'] = request.clusterRegionId;
  }
  if (!Util.isUnset(request.clusterUid)) {
    query['ClusterUid'] = request.clusterUid;
  }
  if (!Util.isUnset(request.ownerUid)) {
    query['OwnerUid'] = request.ownerUid;
  }
  if (!Util.isUnset(request.reportName)) {
    query['ReportName'] = request.reportName;
  }
  if (!Util.isUnset(request.scheduleRule)) {
    query['ScheduleRule'] = request.scheduleRule;
  }
  if (!Util.isUnset(request.timeZoneId)) {
    query['TimeZoneId'] = request.timeZoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateReportTaskRule',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createReportTaskRule(request: CreateReportTaskRuleRequest): CreateReportTaskRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createReportTaskRuleWithOptions(request, runtime);
}

model DeleteReportTaskRuleRequest {
  clusterRegionId?: string(name='ClusterRegionId'),
  clusterUid?: string(name='ClusterUid'),
  ownerUid?: long(name='OwnerUid'),
  ruleId?: string(name='RuleId'),
}

model DeleteReportTaskRuleResponseBody = {
  code?: string(name='Code'),
  isSuccess?: boolean(name='IsSuccess'),
  reportUid?: string(name='ReportUid'),
  requestId?: string(name='RequestId'),
}

model DeleteReportTaskRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteReportTaskRuleResponseBody(name='body'),
}

async function deleteReportTaskRuleWithOptions(request: DeleteReportTaskRuleRequest, runtime: Util.RuntimeOptions): DeleteReportTaskRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterRegionId)) {
    query['ClusterRegionId'] = request.clusterRegionId;
  }
  if (!Util.isUnset(request.clusterUid)) {
    query['ClusterUid'] = request.clusterUid;
  }
  if (!Util.isUnset(request.ownerUid)) {
    query['OwnerUid'] = request.ownerUid;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteReportTaskRule',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteReportTaskRule(request: DeleteReportTaskRuleRequest): DeleteReportTaskRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteReportTaskRuleWithOptions(request, runtime);
}

model GetClusterCheckItemRequest {
  clusterRegionId?: string(name='ClusterRegionId'),
  clusterUid?: string(name='ClusterUid'),
  enableFilter?: boolean(name='EnableFilter'),
  language?: string(name='Language'),
  ownerUid?: long(name='OwnerUid'),
  reportUid?: string(name='ReportUid'),
}

model GetClusterCheckItemResponseBody = {
  checkResult?: {
    checkId?: string(name='CheckId'),
    cluster?: [ 
      {
        desc?: string(name='Desc'),
        display?: string(name='Display'),
        fix?: string(name='Fix'),
        group?: string(name='Group'),
        level?: string(name='Level'),
        message?: string(name='Message'),
        name?: string(name='Name'),
        refer?: string(name='Refer'),
        value?: string(name='Value'),
      }
    ](name='Cluster'),
    nodes?: [ 
      {
        desc?: string(name='Desc'),
        display?: string(name='Display'),
        fix?: string(name='Fix'),
        group?: string(name='Group'),
        level?: map[string]CheckResultNodesLevelValue(name='Level'),
        name?: string(name='Name'),
        refer?: string(name='Refer'),
      }
    ](name='Nodes'),
  }(name='CheckResult'),
  code?: string(name='Code'),
  isSuccess?: boolean(name='IsSuccess'),
  requestId?: string(name='RequestId'),
}

model GetClusterCheckItemResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetClusterCheckItemResponseBody(name='body'),
}

async function getClusterCheckItemWithOptions(request: GetClusterCheckItemRequest, runtime: Util.RuntimeOptions): GetClusterCheckItemResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetClusterCheckItem',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getClusterCheckItem(request: GetClusterCheckItemRequest): GetClusterCheckItemResponse {
  var runtime = new Util.RuntimeOptions{};
  return getClusterCheckItemWithOptions(request, runtime);
}

model GetClusterCheckResultRequest {
  checklistName?: string(name='ChecklistName'),
  clusterRegionId?: string(name='ClusterRegionId'),
  ownerUid?: long(name='OwnerUid'),
  reportUid?: string(name='ReportUid'),
}

model GetClusterCheckResultResponseBody = {
  checkEntryResults?: [ 
    {
      checkSummary?: {
        code?: string(name='Code'),
        errorCount?: int32(name='ErrorCount'),
        normalCount?: int32(name='NormalCount'),
        process?: int32(name='Process'),
        unknownCount?: int32(name='UnknownCount'),
        warnCount?: int32(name='WarnCount'),
      }(name='CheckSummary'),
      entryGroupName?: string(name='EntryGroupName'),
      entryName?: string(name='EntryName'),
      errorInstanceResult?: [ 
        {
          checkpointResults?: [ 
            {
              adviseCode?: string(name='AdviseCode'),
              affectCode?: string(name='AffectCode'),
              checkpointName?: string(name='CheckpointName'),
              messageCode?: string(name='MessageCode'),
              messageLevel?: string(name='MessageLevel'),
            }
          ](name='CheckpointResults'),
          extend?: map[string]any(name='Extend'),
          instanceId?: string(name='InstanceId'),
          instanceName?: string(name='InstanceName'),
          instanceType?: string(name='InstanceType'),
        }
      ](name='ErrorInstanceResult'),
      normalInstanceResult?: [ 
        {
          checkpointResults?: [ 
            {
              adviseCode?: string(name='AdviseCode'),
              affectCode?: string(name='AffectCode'),
              checkpointName?: string(name='CheckpointName'),
              messageCode?: string(name='MessageCode'),
              messageLevel?: string(name='MessageLevel'),
            }
          ](name='CheckpointResults'),
          extend?: map[string]any(name='Extend'),
          instanceId?: string(name='InstanceId'),
          instanceName?: string(name='InstanceName'),
          instanceType?: string(name='InstanceType'),
        }
      ](name='NormalInstanceResult'),
      unknownInstanceResult?: [ 
        {
          checkpointResults?: [ 
            {
              adviseCode?: string(name='AdviseCode'),
              affectCode?: string(name='AffectCode'),
              checkpointName?: string(name='CheckpointName'),
              messageCode?: string(name='MessageCode'),
              messageLevel?: string(name='MessageLevel'),
            }
          ](name='CheckpointResults'),
          extend?: map[string]any(name='Extend'),
          instanceId?: string(name='InstanceId'),
          instanceName?: string(name='InstanceName'),
          instanceType?: string(name='InstanceType'),
        }
      ](name='UnknownInstanceResult'),
      warnInstanceResult?: [ 
        {
          checkpointResults?: [ 
            {
              adviseCode?: string(name='AdviseCode'),
              affectCode?: string(name='AffectCode'),
              checkpointName?: string(name='CheckpointName'),
              messageCode?: string(name='MessageCode'),
              messageLevel?: string(name='MessageLevel'),
            }
          ](name='CheckpointResults'),
          extend?: map[string]any(name='Extend'),
          instanceId?: string(name='InstanceId'),
          instanceName?: string(name='InstanceName'),
          instanceType?: string(name='InstanceType'),
        }
      ](name='WarnInstanceResult'),
    }
  ](name='CheckEntryResults'),
  checkStatus?: string(name='CheckStatus'),
  checkSummary?: {
    code?: string(name='Code'),
    errorCount?: int32(name='ErrorCount'),
    normalCount?: int32(name='NormalCount'),
    process?: int32(name='Process'),
    unknownCount?: int32(name='UnknownCount'),
    warnCount?: int32(name='WarnCount'),
  }(name='CheckSummary'),
  code?: string(name='Code'),
  isSuccess?: boolean(name='IsSuccess'),
  name?: string(name='Name'),
  reportUid?: string(name='ReportUid'),
  requestId?: string(name='RequestId'),
}

model GetClusterCheckResultResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetClusterCheckResultResponseBody(name='body'),
}

async function getClusterCheckResultWithOptions(request: GetClusterCheckResultRequest, runtime: Util.RuntimeOptions): GetClusterCheckResultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.checklistName)) {
    query['ChecklistName'] = request.checklistName;
  }
  if (!Util.isUnset(request.clusterRegionId)) {
    query['ClusterRegionId'] = request.clusterRegionId;
  }
  if (!Util.isUnset(request.ownerUid)) {
    query['OwnerUid'] = request.ownerUid;
  }
  if (!Util.isUnset(request.reportUid)) {
    query['ReportUid'] = request.reportUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetClusterCheckResult',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getClusterCheckResult(request: GetClusterCheckResultRequest): GetClusterCheckResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return getClusterCheckResultWithOptions(request, runtime);
}

model GetClusterReportSummaryRequest {
  clusterRegionId?: string(name='ClusterRegionId'),
  ownerUid?: long(name='OwnerUid'),
  reportUid?: string(name='ReportUid'),
}

model GetClusterReportSummaryResponseBody = {
  addonName?: string(name='AddonName'),
  checkEndTime?: long(name='CheckEndTime'),
  checkStartTime?: long(name='CheckStartTime'),
  checkStatus?: string(name='CheckStatus'),
  checkSummary?: {
    code?: string(name='Code'),
    process?: int32(name='Process'),
  }(name='CheckSummary'),
  checklistResults?: [ 
    {
      checkStatus?: string(name='CheckStatus'),
      checkSummary?: {
        code?: string(name='Code'),
        process?: int32(name='Process'),
      }(name='CheckSummary'),
      name?: string(name='Name'),
    }
  ](name='ChecklistResults'),
  clusterUid?: string(name='ClusterUid'),
  code?: string(name='Code'),
  createTime?: string(name='CreateTime'),
  isSuccess?: boolean(name='IsSuccess'),
  name?: string(name='Name'),
  requestId?: string(name='RequestId'),
  uid?: string(name='Uid'),
}

model GetClusterReportSummaryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetClusterReportSummaryResponseBody(name='body'),
}

async function getClusterReportSummaryWithOptions(request: GetClusterReportSummaryRequest, runtime: Util.RuntimeOptions): GetClusterReportSummaryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterRegionId)) {
    query['ClusterRegionId'] = request.clusterRegionId;
  }
  if (!Util.isUnset(request.ownerUid)) {
    query['OwnerUid'] = request.ownerUid;
  }
  if (!Util.isUnset(request.reportUid)) {
    query['ReportUid'] = request.reportUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetClusterReportSummary',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getClusterReportSummary(request: GetClusterReportSummaryRequest): GetClusterReportSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return getClusterReportSummaryWithOptions(request, runtime);
}

model GetDiagnosisCheckItemRequest {
  diagnosisId?: string(name='DiagnosisId'),
  language?: string(name='Language'),
  ownerUid?: long(name='OwnerUid'),
}

model GetDiagnosisCheckItemResponseBody = {
  checkItems?: [ 
    {
      desc?: string(name='Desc'),
      display?: string(name='Display'),
      group?: string(name='Group'),
      level?: string(name='Level'),
      message?: string(name='Message'),
      name?: string(name='Name'),
      refer?: string(name='Refer'),
      value?: string(name='Value'),
    }
  ](name='CheckItems'),
  code?: string(name='Code'),
  isSuccess?: boolean(name='IsSuccess'),
  requestId?: string(name='RequestId'),
}

model GetDiagnosisCheckItemResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetDiagnosisCheckItemResponseBody(name='body'),
}

async function getDiagnosisCheckItemWithOptions(request: GetDiagnosisCheckItemRequest, runtime: Util.RuntimeOptions): GetDiagnosisCheckItemResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDiagnosisCheckItem',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDiagnosisCheckItem(request: GetDiagnosisCheckItemRequest): GetDiagnosisCheckItemResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDiagnosisCheckItemWithOptions(request, runtime);
}

model GetDiagnosisFeedbackRequest {
  clusterRegionId?: string(name='ClusterRegionId'),
  clusterUid?: string(name='ClusterUid'),
  ownerUid?: long(name='OwnerUid'),
  taskId?: string(name='TaskId'),
  taskName?: string(name='TaskName'),
}

model GetDiagnosisFeedbackResponseBody = {
  code?: string(name='Code'),
  isFinished?: boolean(name='IsFinished'),
  isSuccess?: boolean(name='IsSuccess'),
  requestId?: string(name='RequestId'),
}

model GetDiagnosisFeedbackResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetDiagnosisFeedbackResponseBody(name='body'),
}

async function getDiagnosisFeedbackWithOptions(request: GetDiagnosisFeedbackRequest, runtime: Util.RuntimeOptions): GetDiagnosisFeedbackResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterRegionId)) {
    query['ClusterRegionId'] = request.clusterRegionId;
  }
  if (!Util.isUnset(request.clusterUid)) {
    query['ClusterUid'] = request.clusterUid;
  }
  if (!Util.isUnset(request.ownerUid)) {
    query['OwnerUid'] = request.ownerUid;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDiagnosisFeedback',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDiagnosisFeedback(request: GetDiagnosisFeedbackRequest): GetDiagnosisFeedbackResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDiagnosisFeedbackWithOptions(request, runtime);
}

model GetDiagnosisResultRequest {
  diagnosisId?: string(name='DiagnosisId'),
  language?: string(name='Language'),
  ownerUid?: long(name='OwnerUid'),
}

model GetDiagnosisResultResponseBody = {
  code?: string(name='Code'),
  diagnosis?: {
    clusterUid?: string(name='ClusterUid'),
    code?: long(name='Code'),
    created?: string(name='Created'),
    diagnosisId?: string(name='DiagnosisId'),
    finished?: string(name='Finished'),
    message?: string(name='Message'),
    result?: string(name='Result'),
    status?: long(name='Status'),
    target?: string(name='Target'),
    type?: string(name='Type'),
  }(name='Diagnosis'),
  isSuccess?: boolean(name='IsSuccess'),
  requestId?: string(name='RequestId'),
}

model GetDiagnosisResultResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetDiagnosisResultResponseBody(name='body'),
}

async function getDiagnosisResultWithOptions(request: GetDiagnosisResultRequest, runtime: Util.RuntimeOptions): GetDiagnosisResultResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDiagnosisResult',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDiagnosisResult(request: GetDiagnosisResultRequest): GetDiagnosisResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDiagnosisResultWithOptions(request, runtime);
}

model ListClusterReportSummaryRequest {
  addonName?: string(name='AddonName'),
  clusterRegionId?: string(name='ClusterRegionId'),
  clusterUid?: string(name='ClusterUid'),
  ownerUid?: long(name='OwnerUid'),
  pageNo?: string(name='PageNo'),
  pageSize?: string(name='PageSize'),
  reportName?: string(name='ReportName'),
}

model ListClusterReportSummaryResponseBody = {
  code?: string(name='Code'),
  isSuccess?: boolean(name='IsSuccess'),
  pageNo?: int32(name='PageNo'),
  pageSize?: int32(name='PageSize'),
  reportSummaries?: [ 
    {
      checkEndTime?: long(name='CheckEndTime'),
      checkStartTime?: long(name='CheckStartTime'),
      checkStatus?: string(name='CheckStatus'),
      checkSummary?: {
        code?: string(name='Code'),
        process?: int32(name='Process'),
      }(name='CheckSummary'),
      checklistResults?: [ 
        {
          checkStatus?: string(name='CheckStatus'),
          checkSummary?: {
            code?: string(name='Code'),
            process?: int32(name='Process'),
          }(name='CheckSummary'),
          name?: string(name='Name'),
        }
      ](name='ChecklistResults'),
      clusterUid?: string(name='ClusterUid'),
      createTime?: string(name='CreateTime'),
      name?: string(name='Name'),
      uid?: string(name='Uid'),
    }
  ](name='ReportSummaries'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListClusterReportSummaryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListClusterReportSummaryResponseBody(name='body'),
}

async function listClusterReportSummaryWithOptions(request: ListClusterReportSummaryRequest, runtime: Util.RuntimeOptions): ListClusterReportSummaryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.addonName)) {
    query['AddonName'] = request.addonName;
  }
  if (!Util.isUnset(request.clusterRegionId)) {
    query['ClusterRegionId'] = request.clusterRegionId;
  }
  if (!Util.isUnset(request.clusterUid)) {
    query['ClusterUid'] = request.clusterUid;
  }
  if (!Util.isUnset(request.ownerUid)) {
    query['OwnerUid'] = request.ownerUid;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.reportName)) {
    query['ReportName'] = request.reportName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListClusterReportSummary',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listClusterReportSummary(request: ListClusterReportSummaryRequest): ListClusterReportSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return listClusterReportSummaryWithOptions(request, runtime);
}

model ListDeprecatedAPIRequest {
  clusterRegionId?: string(name='ClusterRegionId'),
  clusterUid?: string(name='ClusterUid'),
  ownerUid?: long(name='OwnerUid'),
  pageNo?: string(name='PageNo'),
  pageSize?: string(name='PageSize'),
}

model ListDeprecatedAPIResponseBody = {
  code?: string(name='Code'),
  deprecatedK8sAPI?: [ 
    {
      clusterId?: string(name='ClusterId'),
      count?: long(name='Count'),
      label?: string(name='Label'),
      requestURI?: string(name='RequestURI'),
      targetVersion?: string(name='TargetVersion'),
      userAgent?: string(name='UserAgent'),
    }
  ](name='DeprecatedK8sAPI'),
  isSuccess?: boolean(name='IsSuccess'),
  pageNo?: int32(name='PageNo'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListDeprecatedAPIResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListDeprecatedAPIResponseBody(name='body'),
}

async function listDeprecatedAPIWithOptions(request: ListDeprecatedAPIRequest, runtime: Util.RuntimeOptions): ListDeprecatedAPIResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterRegionId)) {
    query['ClusterRegionId'] = request.clusterRegionId;
  }
  if (!Util.isUnset(request.clusterUid)) {
    query['ClusterUid'] = request.clusterUid;
  }
  if (!Util.isUnset(request.ownerUid)) {
    query['OwnerUid'] = request.ownerUid;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDeprecatedAPI',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDeprecatedAPI(request: ListDeprecatedAPIRequest): ListDeprecatedAPIResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDeprecatedAPIWithOptions(request, runtime);
}

model ListReportTaskRequest {
  clusterRegionId?: string(name='ClusterRegionId'),
  clusterUid?: string(name='ClusterUid'),
  reportName?: string(name='ReportName'),
}

model ListReportTaskResponseBody = {
  code?: string(name='Code'),
  pageNo?: long(name='PageNo'),
  pageSize?: long(name='PageSize'),
  reportTasks?: [ 
    {
      endTime?: long(name='EndTime'),
      reportUid?: string(name='ReportUid'),
      result?: string(name='Result'),
      startTime?: long(name='StartTime'),
      status?: string(name='Status'),
      taskId?: string(name='TaskId'),
    }
  ](name='ReportTasks'),
  requestId?: map[string]any(name='RequestId'),
  success?: boolean(name='Success'),
  totalCount?: long(name='TotalCount'),
}

model ListReportTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListReportTaskResponseBody(name='body'),
}

async function listReportTaskWithOptions(request: ListReportTaskRequest, runtime: Util.RuntimeOptions): ListReportTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterRegionId)) {
    query['ClusterRegionId'] = request.clusterRegionId;
  }
  if (!Util.isUnset(request.clusterUid)) {
    query['ClusterUid'] = request.clusterUid;
  }
  if (!Util.isUnset(request.reportName)) {
    query['ReportName'] = request.reportName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListReportTask',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listReportTask(request: ListReportTaskRequest): ListReportTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return listReportTaskWithOptions(request, runtime);
}

model ListReportTaskRuleRequest {
  clusterRegionId?: string(name='ClusterRegionId'),
  clusterUid?: string(name='ClusterUid'),
}

model ListReportTaskRuleResponseBody = {
  code?: string(name='Code'),
  isSuccess?: boolean(name='IsSuccess'),
  reportTaskRules?: [ 
    {
      clusterUid?: string(name='ClusterUid'),
      reportName?: string(name='ReportName'),
      ruleId?: string(name='RuleId'),
      scheduleRule?: string(name='ScheduleRule'),
      timeZoneId?: string(name='TimeZoneId'),
    }
  ](name='ReportTaskRules'),
  requestId?: map[string]any(name='RequestId'),
}

model ListReportTaskRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListReportTaskRuleResponseBody(name='body'),
}

async function listReportTaskRuleWithOptions(request: ListReportTaskRuleRequest, runtime: Util.RuntimeOptions): ListReportTaskRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterRegionId)) {
    query['ClusterRegionId'] = request.clusterRegionId;
  }
  if (!Util.isUnset(request.clusterUid)) {
    query['ClusterUid'] = request.clusterUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListReportTaskRule',
    version = '2018-08-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listReportTaskRule(request: ListReportTaskRuleRequest): ListReportTaskRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return listReportTaskRuleWithOptions(request, runtime);
}

